package order

import (
	//"bee/models"
	//"errors"
	//"github.com/go-resty/resty/v2"
	//"github.com/tidwall/gjson"
	//"net/http"
	//"strings"
)

type Remittance struct {
	AccountName string `json:"accountName"`
	AccountNo   string `json:"accountNo"`
	AmountEnd   string `json:"amountEnd"`
	AmountStart string `json:"amountStart"`
	DateEnd     string `json:"dateEnd"`
	DateStart   string `json:"dateStart"`
	PageNo      int64  `json:"pageNo"`
	PageSize    int64  `json:"pageSize"`
}

func QueryRemittance(fullName, bankID, appNamespace string) (remittanceId string, err error) {
	return "", nil
	//appName := "opc"
	//uri := "/api/opc/pay/queryRemittance"
	//
	//appId, appErr:= models.GetAppIdByName(appName)
	//if appErr != nil {
	//	return "", appErr
	//}
	//
	//appEnv, envErr:= models.GetAppEnvInfo(appId, appNamespace)
	//if envErr != nil {
	//	return "", envErr
	//}
	//
	//host := appEnv.AppDomain
	//if !strings.HasPrefix(host, "http://") {
	//	host = "http://" + host
	//}
	//
	//headerData := make(map[string]string)
	//headerData["Content-Type"] = "application/json;charset=UTF-8"
	//
	//remittanceQuery := Remittance{
	//	AccountName: fullName,
	//	AccountNo:   bankID,
	//	AmountEnd:   "",
	//	AmountStart: "",
	//	DateEnd:     "",
	//	DateStart:   "",
	//	PageNo:      1,
	//	PageSize:    20,
	//}
	//
	//client := resty.New()
	//ssoCookie := &http.Cookie{
	//	Name:       "sso-epctoken",
	//	Value:      appEnv.Token,
	//}
	//
	//remittanceResp, _ := client.R().SetHeaders(headerData).
	//	SetCookie(ssoCookie).
	//	SetBody(remittanceQuery).
	//	Post(host + uri)
	//
	//remittanceIdList := gjson.GetBytes(remittanceResp.Body(), "data.list")
	//length := len(remittanceIdList.Array())
	//if length == 0 {
	//	return "", errors.New("返回流水列表不能为空")
	//}
	//
	//return gjson.Get(remittanceIdList.Array()[0].String(), "remittanceId").String(), nil

}